{__NOLAYOUT__}
<!DOCTYPE html>
<html>
<head>
    <title>__TITLE__</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="author" content="ecy.cc">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
	<meta name="apple-touch-fullscreen" content="yes">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
    <script src="__COMMON__/js/requirejs.js" charset="utf-8"></script>
	<script src="__COMMON__/js/jquery-1.11.1.min.js" charset="utf-8"></script>
	<script src="__STYLE__/DisShop/script/app.js" charset="utf-8"></script>
	<script type="text/javascript">
		requirejs.config({
			baseUrl: "__COMMON__/js",
			paths: {
				modal: "__COMMON__/js/2/modal",
				swiper: "__COMMON__/swiper/swiper2.0",
				artTemplate: "__COMMON__/js/artTemplate",
				wx: 'http://res.wx.qq.com/open/js/jweixin-1.0.0',
			}
		});
	</script>
	<link rel="stylesheet" type="text/css" href="__STYLE__/DisShop/style/base2013.css" />
	<link rel="stylesheet" type="text/css" href="__STYLE__/DisShop/style/all_html5.css" />
	<link rel="stylesheet" type="text/css" href="__STYLE__/DisShop/style/view.css" />
	<style type="text/css">
	/* 评论 */
	.comment{clear:both;margin-top:1em;}
	.comment .tit{
		height:2.5em;
		line-height:2.5em;
		text-indent:0.5em;
		background-color: #eee;
		-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.2);
		box-shadow: 0 1px 1px rgba(0,0,0,.2);
		border-top: 0.2em solid #b10000;
	}
	.comment .item{
		padding:0.5em;
		padding-top:1em;
	 border-bottom: 1px solid #e4e4e4;
	}
	.comment .item .con{
	line-height: 1.5;
	font-size: 1em;
	margin-bottom: .5em;
	word-wrap: break-word;
	}
	.comment .item .username, .comment .item .t{
		color:#999;
		font-size:0.5em;
	}
	.comment .page{width:18em; margin:auto; padding-top:0.5em;}
	.comment .i{ 
		float:left;
		padding:0em 0.5em;
		display:inline-block;}
	.comment .btn{
	cursor:pointer;
	padding:0.4em 0.8em;
	vertical-align: middle;
	background-color: #fff;
	border: 1px solid #ccc;
	color: #333;
	font-size: 1em;
	}
	.comment .btn-disabled{
	padding:0.4em 0.8em;
	vertical-align: middle;
	background-color: #fff;
	border: 1px solid #ccc;
	color: #999;
	font-size: .14rem;
	}
	.comment .s{
		float:left;
		width:60px;
		text-align:center;
	}
	.comment .num{
		padding:0.3em 0.8em;
		color:#333;
		border:1px solid #ccc;
		font-size:1em;
	}
	.comment .btn-gree{display: block;width: 60%; height: 30px; line-height: 30px; margin:5px auto; color: #fff; border:none; background:none; background: url(templates/miaosha/image/btn_3_bg.png) left center repeat-x; text-align: center; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; cursor:pointer;}
	.comment .goods-desc{min-height:5em; border:none; background:none; border:1px solid #ccc; border-radius:3px; width:90%; margin:auto;}
	.comment .captcha{width:95%;margin:auto;text-align:left;}
	.comment .captcha input{border:1px solid #ccc;padding:0;margin:0;height:20px;line-height:20px;}
	
	
	/* 幻灯片 */
	.new-gd-img{height: auto;box-sizing: border-box;width: 100%;}
	.lbt{width: 100%;position: relative;}
	.lbt:after{
	    content: ' ';
	    display: block;
	    clear: both;
	    height: 0;
	}
	.lbt .viewport {
	    width: 250px;
	    margin: auto;
	    overflow: hidden;
	}
	.lbt .flipsnap{
	
	}
	.lbt .flipsnap:after {
	    content: '';
	    display: block;
	    clear: both;
	    height: 0;
	}
	.lbt .pointer{
	    width: 250px;
	    margin: auto;
	}
	.lbt .pointer:after{
	    content: ' ';
	    display: block;
	    clear: both;
	    height: 0;
	}
	.lbt .pointer span{
	    float: left;
	    height: 4px;
	}
	.lbt .pointer .hover{
	    background-color: #ed3e69;
	}
	.swipe-wrap {overflow: hidden;position: relative;}
	.swipe-wrap > div {float:left;width:100%;position: relative;}
	.swipe-wrap > div img{display: block;width: 100%;}
	.indicator{display: -webkit-box;}
	.indicator span{display: block;height: 5px;-webkit-box-flex:1;background-color: #c6c6c6;}
	.indicator span.hover{background-color: #ef3d69;}
	#_flipsnap_pointer{background-color: #cccccc;}
	.bdshare_t img{width: 25px;height: 25px;margin-top: 7px;}
	.new-gd-tit .new-txt6c{font-size: 16px;}
	.new-gd-img .new-fl:last-child{padding: 5px 0;}
	.new-gd-txt, .new-gd-txt2, .new-gd-option{font-size: 14px;}
	.new-gd-img{border: none;background: none;}
	.prosx{margin: auto;border: none;padding: 0;font-size: 14px;color: #545353;}
	</style>
</head>

<body style="padding: 0;" data-goods-id="1126">



<!-- 搜索 S -->
<style type="text/css">
    *{margin: 0;padding: 0;}
    .search{background-color: #c6c6c6;padding: 10px 0;}
    .search .inner{width: 90%;margin: auto;position: relative;}
    .search .inner input{display: block;width: 100%;border: none;border-radius: 5px;padding: 8px 0;font-size: 1em;}
    .search .inner img{display: block;width: 20px;height: 20px;position: absolute;right: 2px;top: 6px;}
</style>
<div class="search">
    <form name="searchForm" method="get" action="__CONTROLLER__/list" class="inner">
        <input type="text" name="keywords" placeholder="请输入关键字搜索"/>
        <input type="hidden" name="sid" value="{$sid}">
        <img src="__STYLE__/DisShop/images/fangdajing.png" onclick="document.forms['searchForm'].submit();"/>
    </form>
</div>
<!-- 搜索 E -->




<!-- 轮播图 S -->
<div class="lbt">
    <div class="viewport swipe">
        <div id="_flipsnap" class="flipsnap swipe-wrap">
        	<volist name="shopGoods['images']" id="vo">
            <div class="item">
                <a href="javascript:void(0);">
                    <img src="{$vo}" alt=""/>
                </a>
            </div>
            </volist>
        </div>
    </div>
    <div id="indicator" class="pointer"></div>
</div>
<script type="text/javascript">
	require(['swiper'], function(swiper) {
	    //初始化幻灯片指示点
	    var indicatorCount = $(".lbt .item").length;
	    for(var i = 0;i < indicatorCount;i++) {
	        var span = document.createElement("span");
	        span.style.width = ($(".lbt .swipe").width()/indicatorCount)*1 + "px";
	        if(i == 0) {
	            span.setAttribute("class", "hover");
	        }
	        document.getElementById("indicator").appendChild(span);
	    }
	    new swiper($('.swipe').get(0), {
	        startSlide: 0,
	        speed: 400,
	        auto: 3000,
	        continuous: false,
	        disableScroll: false,
	        stopPropagation: false,
	        callback: function(index, elem) {
	            $("#indicator span").each(function(i) {
	                if(i == index) {
	                    $(this).addClass("hover");
	                } else {
	                    $(this).removeClass("hover");
	                }
	            });
	        },
	        transitionEnd: function(index, elem) {}
	    });
	});
</script>
<!-- 轮播图 E -->



<!-- 购买操作面板 S -->
<div class="new-gd-img">
    <div class="new-gd-tit">
        <p class="new-txt6c" id="title" style="padding: 3px 0;">{$shopGoods.name}</p>
        <div style="font-size: 1em;">
            <font color="red"></font>
        </div>
    </div>
</div>

<style type="text/css">
    .btn-9dj{display: inline-block;border: 1px solid #cccccc;border-radius:
    4px;padding: 0 8px;font-weight: bold;}
</style>

<form id="pr-form" method="post" action="{:U('DisShopOrder/confirmOrder')}">
	<div class="new-gd-option" style="padding: 0;">
	    <span class="mu_lh">购买数量：</span>
	    <span>
	        <span class="btn-9dj" id="buy-num-minus" data-type="m">-</span>
	        <input name="quantity" type="text" id="buy-num" value="1" size="4" onBlur="changePrice()" class="buynum" style="border:1px solid #ccc;" />
	        <span class="btn-9dj" id="buy-num-plus" style="color: #f00;" data-type="p">+</span>
	    </span>
	    &nbsp;&nbsp;&nbsp;&nbsp;
	</div>
	<div class="new-gd-option" style="display:-webkit-box;">
	    <span class="mu_lh">商品单价：</span>
	    <span class="mu_lc red q-txt" id="ECS_GOODS_AMOUNT">
	        {$shopGoods.price}
	    </span>
	</div>
	<if condition="$shopGoods['reward_currency']*1">
	<div class="new-gd-option" style="padding: 0;">
	    <font color="red"><span>购买本商品将获得<span id="anbi_for_goods"> {$shopGoods['reward_currency']}</span> {$config['currency_config']['name']}</span></font>
	</div>
	</if>
	<input type="hidden" name="id" value="{$shopGoods.id}">
    <input type="hidden" name="sid" value="{$sid}">  
</form>
<script type="text/javascript">
	// 改变商品数量
	var buyNum = $("#buy-num");
	$("#buy-num-minus, #buy-num-plus").on("click", changeNum);
	
	function changeNum() {
	  var v = $(buyNum).val()*1,
	      type = $(this).attr("data-type");
	
	  if ( type === "m" ) {
	    v <= 1 ? APP.alert("数量真的已经不能再少了T^T")
	           : $(buyNum).val(v - 1);
	  } else if ( type === "p" ) {
	    $(buyNum).val(v + 1);
	  };
	};
	
    // 选择属性
    $("#pr-buy-check input[type=radio]").on("change", selectAttr);
    
    function selectAttr() {
      var labels = $(this).siblings("label");
      $(labels).each(function(){
        $(this).removeClass("checked");
      });
      $(this).next().addClass("checked");
    };
    
    //按商品价格计算送多少安币
    function anbiCalculateByGoodsPrice( price ) {
        var goodsPrice = parseFloat(price);
        var integerIndicator = parseInt($("#anbi_for_goods").attr("data-integer"));
        if (integerIndicator == -1) {
            $("#anbi_for_goods").html(parseInt(goodsPrice * 0.10));
        } else {
            $("#anbi_for_goods").html((integerIndicator * $("#buy-num").val()));
        }
    }
</script>
<!-- 购买操作面板 E -->




<!-- 商品内容 S -->
<style type="text/css">
.box-928d {
	display: -webkit-box;
	border-top: 2px solid #ff5000;
	margin: 10px
    auto auto auto;
}

.box-928d .item {
	-webkit-box-flex: 1;
	padding: 10px 0;
	text-align: center;
	background-color: #EFEFEF;
	border-left: 1px solid #dddddd;
	border-bottom: 1px solid #dddddd;
}

.box-928d:first-child {
	border-left: none;
}

.box-928d
    .active {
	-webkit-box-flex: 1;
	padding: 10px 0;
	text-align: center;
	background-color: #FFFFFF;
	border-left: 1px solid #dddddd;
	border-bottom: none;
}
</style>
<div class="box-928d">
    <div class="active" onclick="setTab2(this, 'goods_desc_93k8')" >商品简介</div>
    <div class="item" onclick="setTab2(this, 'goods_detail_2u8d')" >详细介绍</div>
    <div class="item" onclick="setTab2(this, 'goods_comments_7d96')" call-func="moreRate(0);"> 商品评论</div>
</div>
<script type="text/javascript">
    function setTab2(obj, id) {
        $(".box-928d div").each(function() {
            $(this).attr("class", "");
            $(this).attr("class", "item");
        });
        obj.setAttribute("class", "active");

        $("#goods_desc_93k8").css("display", "none");
        $("#goods_detail_2u8d").css("display", "none");
        $("#goods_comments_7d96").css("display", "none");

        var curTagObj = $("#" + id);
        curTagObj.css("display", "block");
        
        if ( obj.getAttribute("call-func") ) {
        	eval(obj.getAttribute("call-func"));
        }
    }
    
    // 获取商品评价内容
    var productId = {$shopGoods.id};
    window.p = 1;
    window.rateLoad = 0;
    window.moreRate = function(showAlert) {
        $.ajax({
        	type:'POST',
        	url:"{:U('Home/DisShopRate/moreRate')}",
        	data: {
        		'sid': "{$sid}",
        		"product_id": "{$shopGoods.id}",
        		'p': window.p++
        	},
        	success: function(data) {
        		if( data.extra.length==0 ) {
        			window.p--;
        			if(showAlert){
        			    APP.alert('没有更多了');
        			}
        		}
        		data.extra && showComment(data.extra);
        	}
        })
    }
    
    function showComment( data ) {
      if(data==null || data.length==0){
          return;
      }
      var html = "";
      for ( var i = 0; item = data[i]; i++ ) {
        html += "<div class=\"item\"><div class=\"con\">" + item.content + "</div>"
               +"<div class=\"b\"><div class=\"f-l\">" + item.userNickName + "</div><div class=\"f-r\"><div class=\"t\">" + new Date(item.create_time*1000).Format("yyyy-MM-dd hh:mm:ss") + "</div></div></div>"
               +"</div>";
      };
      if ( !window.rateLoad ) {
    	  document.getElementById( "product-comment" ).innerHTML = html;
      } else {
    	  $(".product-comment").append(html);
      }
      window.rateLoad = 1;
    };
</script>
<div id="mainLayout" style="display:-webkit-box;">
    <div class="new-ct" id="mainStay" style="-webkit-box-flex: 1;width: 100%; min-height: 10px;">
        <div class="new-goods-details">
            <div id="goods_desc_93k8">
            	<notEmpty name="shopGoods['currency_value']">
            		<font color="red">购买该商品最多可用:{$shopGoods['currency_value']}{$config['currency_config']['name']}</font>
            	</notEmpty>
            </div>
        </div>
        <div id="goods_detail_2u8d" style="display: none;">{$shopGoods.content}</div>
       	<div id="goods_comments_7d96" style="display: none;">
			<div class="comment">
		    	<div id="comment_wrap_0">
		          <div class="tit">评论</div>
		        </div>
		        <div id="product-comment">
		        	
		        </div>
		        <a href="javascript:return false;" style="width: 172px;margin: 20px auto;clear: both;float: none;display: block;" onclick="moreRate(1);">加载更多&gt;&gt;</a>
		    </div>
		</div>
    </div>
</div>
</div>
<style type="text/css">
.relate-articles .tit {
	padding: 0px 12px;
	background-color: #a8a8a8;
	line-height: 27px;
	color: #fff;
	text-align: left;
	font-weight: normal;
	font-family: "Microsoft
    YaHei",微软雅黑;
	font-size: 1em;
}

.relate-articles li.item {
	height: 30px;
	line-height: 30px;
	padding: 0px
    12px;
	position: relative;
	border-bottom: 1px dashed #ccc;
}

.relate-articles
    li.item a {
	display: block;
	width: 100%;
	height: 100%;
	color: #333;
	text-decoration: none;
	position: relative;
}

.relate-articles li.item a:after {
	content: ' ';
	position: absolute;
	top: 10px;
	right: 2px;
	width: 6px;
	height: 6px;
	border: #656565 solid;
	border-width: 2px 2px 0 0;
	-webkit-transform: rotate(45deg);
}
</style>
</form>
<!-- 商品内容 E -->




<!-- footer S-->
<style type="text/css">
    .clear{clear: both;}
    .footer-20150126{font-size: 1em;text-align: center;color: #767575;}
    .footer-20150126 .link{text-align: center;line-height: 150%;padding: 8px 0 5px 0;}
    .footer-20150126 .link a{display: block;width: 100px;margin: auto;text-decoration: none;color: #767575;}
    .footer-20150126 .link a img{display: block;width: 100%;}
    .footer-20150126 .services{}
    .footer-20150126 .services .left{float: left;width: 40%;}
    .footer-20150126 .services .left p{float: right;padding-bottom: 10px;width: 100%;}
    .footer-20150126 .services .left p span{float: right;padding-top: 5px;padding-left: 5px;}
    .footer-20150126 .services .left p img{float: right; width: 25px;}
    .footer-20150126 .services .middle{float: left;width: 20%;}
    .footer-20150126 .services .right{float: left;width: 40%;}
    .footer-20150126 .services .right p{float: left;padding-bottom: 10px;width: 100%;}
    .footer-20150126 .services .right p img{float: left;width: 25px;}
    .footer-20150126 .services .right p span{float: left;padding-top: 5px;padding-left: 5px;}
</style>

<footer class="footer-20150126">
    <div class="services">
        <div class="left">
            <p>
                <span>官方直销</span>
                <img src="__STYLE__/DisShop/images/icon-shipping.png"/>
            </p>
            <p>
                <span>统一价格</span>
                <img src="__STYLE__/DisShop/images/icon-money.png"/>
            </p>
        </div>
        <div class="middle">&nbsp;</div>
        <div class="right">
            <p>
                <img src="__STYLE__/DisShop/images/icon-love.png"/>
                <span>正品保证</span>
            </p>
            <p>
                <img src="__STYLE__/DisShop/images/icon-product.png"/>
                <span>服务无忧</span>
            </p>
        </div>
        <div class="clear"></div>
    </div>
    <p class="link">
        <a href="{$config.subscribe_url}">
            <img src="__STYLE__/DisShop/images/img-7.png">
        </a>
    </p>
    
    <div class="pr-copyright">
	    <p>{$config.copyright}</p>
	    <notempty name="config.tel">
	    <p><a href="tel:{$config.tel}" class="underline">联系客服</a></p>
	    </notempty>
	    <p>{$system.bottom}</p>
    </div>
  
</footer>
<!-- footer E-->



<div style="height: 80px;"></div>



<!-- 微信分享开始 S-->
<script type="text/javascript">
	var share = {$share},
		debug = false;
	require(['wx'], function(wx) {
		wx.config({
			debug: debug,
			appId: '{$wxConfig.appId}',
			timestamp: "{$wxConfig.timestamp}",
			nonceStr: '{$wxConfig.nonceStr}',
			signature: '{$wxConfig.signature}',
			jsApiList: [
				'checkJsApi',
				'onMenuShareTimeline',
				'onMenuShareAppMessage',
				'onMenuShareQQ',
				'onMenuShareWeibo',
				'hideMenuItems',
				'showMenuItems',
				'hideAllNonBaseMenuItem',
				'showAllNonBaseMenuItem',
				'translateVoice',
				'startRecord',
				'stopRecord',
				'onRecordEnd',
				'playVoice',
				'pauseVoice',
				'stopVoice',
				'uploadVoice',
				'downloadVoice',
				'chooseImage',
				'previewImage',
				'uploadImage',
				'downloadImage',
				'getNetworkType',
				'openLocation',
				'getLocation',
				'hideOptionMenu',
				'showOptionMenu',
				'closeWindow',
				'scanQRCode',
				'chooseWXPay',
				'openProductSpecificView',
				'addCard',
				'chooseCard',
				'openCard'
			]
		});
		wx.ready(function() {
			wx.onMenuShareAppMessage({
				link: share.link,
				title: share.title,
				desc: share.desc,
				imgUrl: share.imgUrl
			})
			wx.onMenuShareTimeline({
				link: share.link,
				title: share.desc,
				imgUrl: share.imgUrl
			})
		});
	})
</script>
<!-- 微信分享结束 E -->





<!-- 分享提示窗 S-->
<style type="text/css">
.tool-bottom-wrap {
	position: fixed;
	width: 100%;
	left: 0px;
	bottom: 0;
	z-index: 1000;
}

.tool-bottom {
	display: -webkit-box;
	display: -moz-box;
	display: box;
	width: 100%;
	margin: auto;
	z-index: 1000;
	border-top: 2px solid #51515d;
	background: -webkit-gradient(linear,
    0 0, 0 100%, from(#333c45), to(#313540), color-stop(50%, #373a43));
}

.tool-bottom
    .item {
	display: block;
	-moz-box-flex: 1.0;
 	/* Firefox */
	-webkit-box-flex: 1.0;
    /* Safari 和 Chrome */
	box-flex: 1.0;
	border-right: 1px solid #0e111a;
	border-left: 1px solid #666a73;
}

.tool-bottom .item span {
	display: block;
	width: 100%;
	text-align: center;
	font-size: 1.8em;
	color: #fff;
	height: 30px;
	line-height: 30px;
}

.tool-bottom .item strong {
	display: block;
	width: 100%;
	height: 2.5em;
	line-height: 2.5em;
	color: #fff;
	text-align: center;
	font-size: 1em;
	font-weight: normal;
}

.mask {
	display: none;
	position: fixed;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;
	z-index: 8889;
	background-color: #333;
	filter: alpha(opacity=50);
	-moz-opacity: 0.5;
	-khtml-opacity: 0.5;
	opacity: 0.5;
}

.share-pop {
	position: fixed;
	right: 0px;
	top: 0px;
	z-index: 9000;
	display: none;
}

.share-pop .top {
	text-align: right;
}

.share-pop .bottom {
	display: -webkit-box;
	display: -moz-box;
	display: box;
	border: 2px dashed #fff;
	border-radius: 8px;
	-webkit-border-radius: 8px;
	padding: 0.8em 0.5em;
}

.share-pop .bottom div {
	-moz-box-flex: 1.0;
 /* Firefox
    */
	-webkit-box-flex: 1.0;
 /* Safari 和 Chrome */
	box-flex: 1.0;
	text-align: center;
}

.share-pop .bottom img {
	width: 50%;
}

.share-pop .bottom img {
	width: 50%;
}

.share-pop .bottom p {
	color: #fff;
	line-height: 1.5em;
}
</style>
<div id="tool_bottom" class="tool-bottom-wrap">
    <div class="tool-bottom">
        <div style="clear:both">
        </div>
    </div>
</div>
<div id="share_pop" class="share-pop" onclick="hideSharePop()">
    <div class="top">
        <img src="/emall/images/share_1.png" alt="" />
        <img src="/emall/images/share_2.png" alt="" />
    </div>
    <div class="bottom">
        <div>
            <img src="/emall/images/share_4.png" alt="" />
            <p>发送给朋友</p>
        </div>
        <div>
            <img src="/emall/images/share_3.png" alt="" />
            <p>分享到朋友圈</p>
        </div>
    </div>
</div>
<div id="mask_cy" class="mask" onclick="hideSharePop()">
</div>
<script type="text/javascript">
    function set_share_pop_wrap_height() {
        var height = document.documentElement.clientHeight ? document.documentElement.clientHeight: document.body.clientHeight;
        document.getElementById("mask_cy").style.height = height + 'px';
    }
    function showSharePop() {
        document.getElementById("mask_cy").style.display = "block";
        document.getElementById("share_pop").style.display = "block";
    }
    function hideSharePop() {
        document.getElementById("mask_cy").style.display = "none";
        document.getElementById("share_pop").style.display = "none";
    }
</script>
<!-- 分享提示窗 E-->



<!-- 底部导航 S -->
<style type="text/css">
    .float-nav{display: -webkit-box;position: fixed;left: 0;bottom: 0;right: 0;z-index: 100;background-color: #FFFFFF;}
    .float-nav .item-1, .float-nav .item-2, .float-nav .item-3{border-left: 1px solid #d0d0d0;border-top: 1px solid #d9d9d9;}
    .float-nav .item-1{ -webkit-box-flex: 0 ; width: 40px; text-align: center; background-color: #eae9e9;}
    .float-nav .item-1 img{position: relative;top: 8px;}
    .float-nav .item-2 { -webkit-box-flex: 1 ; background-color: #ed3e69; color: #FFFFFF; text-align: center; line-height: 40px;}
    .float-nav .item-3 { -webkit-box-flex: 1 ; background-color: #ed0a34; color: #FFFFFF; text-align: center; line-height: 40px;}
    .float-nav:first-child{border-left: none;}
</style>

<div class="float-nav">
    <div class="item-1">
        <a href="{$config.url}">
            <img src="__STYLE__/DisShop/images/icon-home.png" alt="" width="20" height="20"/>
        </a>
    </div>
    <div class="item-1">
        <a href="{:url(null, 'DisShopCart', 'showCart', 'sid='.$sid)}">
            <img src="__STYLE__/DisShop/images/icon-cart.png" alt="" width="20" height="20"/>
        </a>
    </div>
    <div class="item-1">
        <img src="__STYLE__/DisShop/images/icon-share.png" alt="" width="20" height="20" onclick="showSharePop()"/>
    </div>
   	<if condition="$shopGoods['is_seckill'] || ($shopGoods['price'] eq 0)">
	<else/>
    <div class="item-2" id="pr-addto-cart">加入购物车</div>
    </if>
    <div class="item-3" id="pr-buynow">&nbsp;&nbsp;立即购买&nbsp;&nbsp;</div>
</div>
<script type="text/javascript">
// 加入购物车和购买
$("#pr-addto-cart").on("click", function() {
  var jump = $(this).attr("data-jump")*1;
  isAllChecked(function(){
    insertCart(jump);
  });
});

// 立即购买
$("#pr-buynow").on("click", function() {
  isAllChecked(function(){
	  $('#pr-form').submit();
  });
});

function insertCart(jump) {
  var postData = $("#pr-form").serialize();
  APP.showLoading();

  $.post("{:U('DisShopCart/addItem')}", postData, function(response) {
    APP.hideLoading();
    if ( response.error === 0 ) {
      jump ? $("#pr-form").submit() : insertSuccess();
    } else {
      APP.alert(response.msg);
    };
  });
};

function insertSuccess() {
  require(["modal"], function(M) {
    M.confirm({
      title: "添加到购物车",
      text: "该商品已成功添加到购物车",
      buttons: [{
        text: "继续逛",
        close: true
      }, {
        text: "去购物车",
        click: function() {
          window.location.href = "{:url(null, 'DisShopCart', 'showCart', 'sid='.$sid.'&qid='.$qid)}";
        }
      }]
    })
  });
};

function isAllChecked( callback ) {
  var checkedAll = true;
  $(".pr-check-attr").each(function() {
    var checked = false;
    
    $(this).find("input[type='radio']").each(function() {
      $(this).prop("checked") && ( checked = true );
    });
    
    if ( !checked ) {
      var info = $(this).children(".pr-check-key").attr("data-null");
      APP.alert(info);
      checkedAll = false;
      return false;
    };
  });
  checkedAll && callback && callback();
};
</script>


<!-- 底部导航 E -->


<a href="tel:<if condition="$currentAgent">{$currentAgent.tel}<else/>{$config.tel}</if>">
	<img style="display: block;width: 40px;position: fixed;right: 5px;bottom: 95px;z-index: 100;background-color: #444242;border-radius: 20px;" src="__STYLE__/DisShop/images/icon-tel-1.png">
</a>


<!-- 提示信息窗 S -->
<style type="text/css">
    .mask-c92k{display: none;position: absolute;left: 0;top: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,0.7);}
    .rand-c82k{display: none;position: absolute;left: 0;top: 0;right: 0;bottom: 0;}
    .rand-c82k .content{position: absolute;left: 50%;top: 50%;width: 250px;height: 50px;padding: 10px 25px;margin: 30px auto auto -150px;background-color: #ffffff;border-radius: 4px;box-shadow: 0 0 2px #000;word-break: break-all;word-wrap: break-word;}
</style>

<div class="mask-c92k"></div>
<div id="dialog" class="rand-c82k">
    <div class="content"></div>
</div>

<script type="text/javascript">
    function dialog_1(content, isShow){
        $(".mask-c92k").height($(document).height());
        if(isShow){
            $("#dialog .content").html(content);
            $(".mask-c92k").show();
            $("#dialog").show();
        }else{
            $(".mask-c92k").hide();
            $("#dialog").hide();
        }
    }
</script>
<!-- 提示信息窗  E -->
</body>
</html>